/*=====================================================================================================================
                    Copyright(c) 2009 Geometric PLM Software Corp. All rights reserved.
                             Unpublished - All rights reserved
=======================================================================================================================
File description:
    Filename: vector_c.h
    Module  : Common module.

        This file includes the operations of the simluative vector.

=======================================================================================================================
Date               Name              Description of Change
26-Jan-2010        Jerry,Wu          Initialize creation
$HISTORY$
=====================================================================================================================*/
#ifndef LIST_C_H
#define LIST_C_H

#ifdef __cplusplus
    extern "C"
    {
#endif

    // Define the node structure.
    typedef struct List_Node_s
    {
        struct List_Node_s *preNode;
        void* data;
        struct List_Node_s *nextNode;
    }List_Node_t;

    typedef void (*FREE_FUNC)(void *);

    extern List_Node_t* LIST_createListHead(void *data);

    extern void LIST_assign(List_Node_t *curNode, void *data);

    extern void* LIST_get_data(List_Node_t *curNode);

    extern List_Node_t* LIST_getPreNode(List_Node_t *curNode);

    extern List_Node_t* LIST_getNextNode(List_Node_t *curNode);

    extern List_Node_t* LIST_back(List_Node_t *curNode);

    extern List_Node_t*  LIST_begin(List_Node_t *curNode);

    extern void LIST_clear(List_Node_t **curNode, FREE_FUNC freeFunc);
    
    extern int LIST_size(List_Node_t *curNode);

    extern List_Node_t* LIST_pop_back(List_Node_t **curNode, FREE_FUNC freeFunc);

    extern List_Node_t* LIST_pop_front(List_Node_t **curNode, FREE_FUNC freeFunc);

    extern List_Node_t* LIST_push_back(List_Node_t *curNode, void *data);

    extern List_Node_t* LIST_push_front(List_Node_t *curNode, void *data);

    extern List_Node_t* LIST_remove(List_Node_t **curNode, FREE_FUNC freeFunc);

    extern List_Node_t* LIST_insert(List_Node_t *curNode, void *data);



#ifdef __cplusplus
    }
#endif


#endif
